Make tensorflow optional in requirements - #5086
Conversation
There was a problem hiding this comment.
Code Review
This pull request deprecates the legacy TFDS input pipeline in favor of the Grain pipeline and makes TensorFlow-related packages optional dependencies. It introduces a new tf_requirements.txt file and updates the installation scripts and documentation to support an optional --with-tf flag. Additionally, various generated requirements files are updated with bumped dependency versions. The review feedback recommends removing capture_output=True from the subprocess installation command to prevent the CLI from appearing hung, and suggests adding seqio to the optional TensorFlow requirements since it is needed for the legacy pipeline.
254f7f5 to
a788357
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
a788357 to
88cfadb
Compare
88cfadb to
7730c67
Compare
65cb974 to
659637b
Compare
| @@ -1885,10 +1885,10 @@ def get_tokenizer(self) -> Any: | |||
| """ | |||
| token_params_is_stub = getattr(_token_params_ns, "_IS_STUB", False) | |||
| engine_api_is_stub = getattr(engine_api, "_IS_STUB", False) | |||
| if is_decoupled() and (token_params_is_stub or engine_api_is_stub): | |||
| if token_params_is_stub or engine_api_is_stub: | |||
There was a problem hiding this comment.
Clarification: is_decoupled() is redundant here, token_params_is_stub or engine_api_is_stub is sufficient.
659637b to
cbc8202
Compare
cbc8202 to
4bbafb1
Compare
Description
Summary
Makes
tensorflow,tensorflow-datasets,tensorflow-text,Jetstreamandseqiooptional dependencies in MaxText (Jetstream pulls tensorflow through Jetstream -> seqio_tensorflow-text -> tensorflow). Core pre-training lock files are now TensorFlow-free, while users requiring legacy TFDS pipelines or JetStream serving can install optional dependencies via--with-tf.b/555209521
Changes
tpu-requirements.txt,cuda12-requirements.txt,decoupled-requirements.txt).src/dependencies/extra_deps/tf_requirements.txtandjetstream_github_deps.txtfor optional installation.--with-tfflag (andWITH_TFenv var) toinstall_pre_train_extra_deps.pyto install optional TensorFlow and JetStream dependencies.TFoption tosrc/dependencies/scripts/setup.shanddocker_build_dependency_image.sh(defaults tofalse).ARG TF=trueto Dockerfiles because nightly image workflow does not pass "TF" in build arg yet, will keep TF in nightly images until we build separated workflow for TF and no-TF images.gcloud_stub.pyto return stubs when JetStream or its dependencies are absent, avoiding import crashes.inference_microbenchmark_smoke_test.py,offline_engine_test.py). The following tests are skipped in the no-TF environment. Will follow up with a dedicated jetstream CI workflow for these tests similar to the vllm post-training CI workflow.maxtext.inference.decodeto install--with-tfif absent.install_maxtext.mdanddata_input_tfds.mdwith--with-tfinstructions.Tests
tests/unit/mmap_data_processing_test.py::GrainMmapNpyEvalConfigTestis at head and unrelated to this PR)Checklist
Before submitting this PR, please make sure (put X in square brackets):
gemini-reviewlabel.